package com.loongtech.bi.entity.business;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Entity
@Table(name = "addcash_balance")
public class EntityAddcashBalance implements Serializable {
	private static final long serialVersionUID = 2L;

	@Id
	private Date day; // 日期
	@Id
	private String serverid;
	@Id
	private String channelid;
	@Id
	private String platformid;
	@Id
	private Integer addtype;
	@Column(columnDefinition="bigint(20) NOT NULL default 0")
	private Long sumcashadd;
	@Column(columnDefinition="int(11) NOT NULL default 0")
	private Integer outerorderidnum;
	public Date getDay() {
		return day;
	}
	public void setDay(Date day) {
		this.day = day;
	}
	public String getServerid() {
		return serverid;
	}
	public void setServerid(String serverid) {
		this.serverid = serverid;
	}
	public String getChannelid() {
		return channelid;
	}
	public void setChannelid(String channelid) {
		this.channelid = channelid;
	}
	public String getPlatformid() {
		return platformid;
	}
	public void setPlatformid(String platformid) {
		this.platformid = platformid;
	}
	public Integer getAddtype() {
		return addtype;
	}
	public void setAddtype(Integer addtype) {
		this.addtype = addtype;
	}
	public Long getSumcashadd() {
		return sumcashadd;
	}
	public void setSumcashadd(Long sumcashadd) {
		this.sumcashadd = sumcashadd;
	}
	public Integer getOuterorderidnum() {
		return outerorderidnum;
	}
	public void setOuterorderidnum(Integer outerorderidnum) {
		this.outerorderidnum = outerorderidnum;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((addtype == null) ? 0 : addtype.hashCode());
		result = prime * result
				+ ((channelid == null) ? 0 : channelid.hashCode());
		result = prime * result + ((day == null) ? 0 : day.hashCode());
		result = prime * result
				+ ((outerorderidnum == null) ? 0 : outerorderidnum.hashCode());
		result = prime * result
				+ ((platformid == null) ? 0 : platformid.hashCode());
		result = prime * result
				+ ((serverid == null) ? 0 : serverid.hashCode());
		result = prime * result
				+ ((sumcashadd == null) ? 0 : sumcashadd.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		EntityAddcashBalance other = (EntityAddcashBalance) obj;
		if (addtype == null) {
			if (other.addtype != null)
				return false;
		} else if (!addtype.equals(other.addtype))
			return false;
		if (channelid == null) {
			if (other.channelid != null)
				return false;
		} else if (!channelid.equals(other.channelid))
			return false;
		if (day == null) {
			if (other.day != null)
				return false;
		} else if (!day.equals(other.day))
			return false;
		if (outerorderidnum == null) {
			if (other.outerorderidnum != null)
				return false;
		} else if (!outerorderidnum.equals(other.outerorderidnum))
			return false;
		if (platformid == null) {
			if (other.platformid != null)
				return false;
		} else if (!platformid.equals(other.platformid))
			return false;
		if (serverid == null) {
			if (other.serverid != null)
				return false;
		} else if (!serverid.equals(other.serverid))
			return false;
		if (sumcashadd == null) {
			if (other.sumcashadd != null)
				return false;
		} else if (!sumcashadd.equals(other.sumcashadd))
			return false;
		return true;
	}
	
	@Override
	public String toString() {
		return "EntityAddcashBalance [day=" + day + ", serverid=" + serverid
				+ ", channelid=" + channelid + ", platformid=" + platformid
				+ ", addtype=" + addtype + ", sumcashadd=" + sumcashadd
				+ ", outerorderidnum=" + outerorderidnum + "]";
	}
}